import service from '../internal/service.js'

export function APIGetMoveLineData ({ shop, date = '' }) {
  return service({
    url: `api/shops/${shop}/top-lines/?date=${date}`,
    method: 'get'
  })
}

//  动线路径图
export function APIGetMoveLineBranch ({ shop, startDate = '', endDate = '', startAge = 0, endAge = 100, gender = 0, parentHash = '' }) {
  return service({
    url: `api/shops/${shop}/branch-line-stats?start_date=${startDate}&end_date=${endDate}&start_age=${startAge}&end_age=${endAge}&gender=${gender}&parent_hash=${parentHash}`,
    method: 'get'
  })
}

//  逛店时长（人次 均次 每天）连续多日
export function APIGetStayTimeData ({ shop, startDate, endDate }) {
  return service({
    url: `api/shops/${shop}/stay-time?start_date=${startDate}&end_date=${endDate}`,
    method: 'get'
  })
}

// 逛店频率 （日）
export function APIGetFrequencyOfDailyData ({ shop, date }) {
  return service({
    url: `api/shops/${shop}/enter-shop-frequency-daily?date=${date}`,
    method: 'get'
  })
}

// 逛店频率 （周）
export function APIGetFrequencyOfWeeklyData ({ shop, startDate, endDate }) {
  return service({
    url: `api/shops/${shop}/enter-shop-frequency-weekly?start_date=${startDate}&end_date=${endDate}`,
    method: 'get'
  })
}

// 逛店频率 （月）
export function APIGetFrequencyOfMonthlyData ({ shop, year, month }) {
  return service({
    url: `api/shops/${shop}/enter-shop-frequency-monthly?year=${year}&month=${month}`,
    method: 'get'
  })
}
